package com.zjw.zy.service.net.conver;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.zjw.zy.bean.UIMode;
import com.zjw.zy.utils.GsonUtils;

import java.io.IOException;

import okhttp3.ResponseBody;
import retrofit2.Converter;

/**
 * @author ：zhong.jw
 * @date ：Created in 2022/12/6 9:49
 */
public class IntegerConverter implements Converter<ResponseBody, Integer> {
    @Nullable
    @Override
    public Integer convert(@NonNull ResponseBody value) throws IOException {
        String string = value.string();
        String result = GsonUtils.getNode(string, "result");
        return GsonUtils.fromJson(result, Integer.class);
    }
}
